{extend name="public/base" /}
{block name="style"}<link href="__LIB__/fileinput/css/fileinput.min.css" rel="stylesheet" /> {/block}
{block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>提现申请</strong></li>
	</ol>
</div>
<div class="row">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			{include file="cashmanage/top"}
			<div class="ibox-content">
				<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('withdrawals')}">
					<div class="form-group">
						<label class="col-sm-3 control-label">帐户资产：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="store_balance" name="store_balance" value="{$store_balance}" readonly class="form-control" />
							当前可提现的最大金额
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">冻结金额：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="frozen_balance" name="frozen_balance" value="100" readonly class="form-control" />
							当前正在处理中的金额
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">平台/用户ID：</label>
						<div class="input-group col-sm-4">
							<select name="type " class="form-control" id="type">
                                <option value="1">T+0（手续费2%）</option>
                                <option value="2">T+1（手续费1%）</option>
                                <option value="3">T+2（免手续费）</option>
                            </select>
                            T+1（今天提取明天到账），T+2（今天提取后天到账）
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">提现金额：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="balance" name="balance"  class="form-control"/>
							要提现的金额，特别提示：申请提现会收取提现额度 % 的手续费
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">提现手续费：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="counter_fee" name="counter_fee" class="form-control" readonly=""/>
							提现收取的手续费
						</div>
					</div>
		<div class="form-group">
						<label class="col-sm-3 control-label">选择提现帐户类型：</label>
						<div class="input-group col-sm-4">
						<input type="radio" name="cash_type" value="1" checked=""/> 银行卡
						<input type="radio" name="cash_type" value="2" /> 支付宝		
						<input type="radio" name="cash_type" value="3" /> 微信
						</div>
					</div>
					{volist name="cash_list" id='ca'}
					<div class="form-group bank" >
						<label class="col-sm-3 control-label">开户行：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="bank_account" name="bank_account" value="{$ca.bank_account}"  class="form-control" />
						</div>
					</div>
					<div class="form-group bank" >
						<label class="col-sm-3 control-label">开户人：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="bank_username" name="bank_username" value="{$ca.bank_username}"  class="form-control" />
						</div>
					</div>
					<div class="form-group bank" >
						<label class="col-sm-3 control-label">银行卡号：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="card_no" name="card_no" value="{$ca.card_no}"  class="form-control" />
						</div>
					</div>
					<div class="form-group alipay" style="display:none;">
						<label class="col-sm-3 control-label">支付宝昵称：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="alipay_nickname" name="alipay_nickname" value="{$ca.alipay_nickname}"  class="form-control" />
						</div>
					</div>
					<div class="form-group alipay" style="display:none;">
						<label class="col-sm-3 control-label">支付宝号：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="alipay" name="alipay" value="{$ca.alipay}"  class="form-control" />
						</div>
					</div>
					<div class="form-group wechat" style="display:none;">
						<label class="col-sm-3 control-label">微信昵称：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="wechat_nickname" name="wechat_nickname" value="{$ca.wechat_nickname}"  class="form-control" />
						</div>
					</div>
					<div class="form-group wechat" style="display:none;">
						<label class="col-sm-3 control-label">微信号：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="wechat_account" name="wechat_account" value="{$ca.wechat_account}"  class="form-control" />
						</div>
					</div>
					{/volist}
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<div class="col-sm-4 col-sm-offset-3">
							<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 确认提现</button>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"></label>
						<div class="input-group col-sm-4">
							提现提醒：</br>
							 （1）银行工作日营业时间内9:00-17:00支持T+0到账，营业时间外及每周六、周日暂停T+0提现服务；</br>
							 （2）周六申请T+1，T+2提现，周一到账；</br>
							 （3）周日申请T+1提现，周一到账；申请T+2提现，周二到账。</br>
						 	以上结算日遇休息日或法定节假日的，顺延至休息日或法定节假日结束后的第一个工作日。
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script>
	$("input[name='cash_type']").click(function(){
		var value = $(this).val();
		if(value == '1'){
			$(".alipay").hide();
			$(".wechat").hide();
			$(".bank").show();
		}else if(value == '2'){
			$(".alipay").show();
			$(".wechat").hide();
			$(".bank").hide();
		}else if(value == '3'){
			$(".alipay").hide();
			$(".wechat").show();
			$(".bank").hide();
		}
	})
	
	//顶部导航
	$("#li-bar-withdrawals").addClass("active");
	//ajax表单提交
	$(function() {
		$("#myForm").validate({
			rules: {
				message: "required",
				balance: "required"
			},
			messages: {
				message: ICON.error + "请选择提现类型",
				balance: ICON.error + "请输入提现金额"
			},
			submitHandler: function(form) {
				ajaxForm();
			}
		});
	});
</script>
{/block}